﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Foundation;

namespace лаба5
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }

        public double tomatvalue,cucumbervalue;
    
        private void button1_Click(object sender, EventArgs e)
        {
            VegetableCreator Creator = new Foundation.VegetableCreator();
            double TomatWeight;
            double CucumbWeight;
            TomatWeight = Convert.ToDouble(textBox1.Text)/1000;
            CucumbWeight = Convert.ToDouble(textBox2.Text)/1000;
            Tomato tomat = Creator.CreateTomato(TomatWeight);
            Cucumber cucumb = Creator.CreateCucumber(CucumbWeight);
            Salat salat = Creator.CreateSalat(tomat, cucumb);
            CaloriesCalculater Calculator = new CaloriesCalculater();
            double Calories;
            double Vitamins;
            Calories = Calculator.CaloriesCalculate(salat);
            Vitamins = Calculator.VitaminsCalculate(salat);
            string inf = "Калории в салате: " + Convert.ToString(Calories) + "\n" + "Витамины в салате: " + Convert.ToString(Vitamins);
            MessageBox.Show(inf);
        }      
    }
}
